package com.njmaomao.gj.pyot.domain.wechat.wechatapi;

import com.njmaomao.gj.pyot.common.XmlUtil;
import com.thoughtworks.xstream.annotations.XStreamAlias;

/**支付通知和退款通知返回给微信的消息体
 * @author Dylan
 * @time 2018/5/21.
 */
@XStreamAlias("xml")
public class WechatNotificationResp {

    @XStreamAlias("return_code")
    private String returnCode;

    @XStreamAlias("return_msg")
    private String returnMsg;

    public WechatNotificationResp() {
    }

    public WechatNotificationResp(String returnCode, String returnMsg) {
        this.returnCode = returnCode;
        this.returnMsg = returnMsg;
    }

    public String getReturnCode() {
        return returnCode;
    }

    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }

    public String getReturnMsg() {
        return returnMsg;
    }

    public void setReturnMsg(String returnMsg) {
        this.returnMsg = returnMsg;
    }

    public static WechatNotificationResp success(){
        return new WechatNotificationResp("SUCCESS","OK");
    }

    public static WechatNotificationResp fail(String msg){
        return new WechatNotificationResp("FAIL",msg);
    }

    public String toXml(){
        return XmlUtil.objectToXml(this);
    }
}
